<div class="workerInfo main">
  <div class="personnel-information shadowbox">
    <div class="container-header">人员信息</div>
    <form class="base-info pa-form-content">
      <div class="row-item">
        <div class="pa-form-control">
          <label class="name fl">档案编号:</label>
          <div class="pa-input fl">
            <input type="text"
              ng-model="workerInfo.userInfo.recordNo"/>
          </div>
        </div>
        <div class="pa-form-control">
          <label class="name fl">姓&nbsp;名:</label>
          <div class="pa-input fl">
            <input type="text"
              ng-model="workerInfo.userInfo.name"/>
          </div>
        </div>
        <div class="pa-form-control">
          <label class="name fl">所属标段:</label>
          <div class="pa-input fl">
            <select id="type" name="type" ng-model="workerInfo.userInfo.markSection">
              <option value=""></option>
              <option
                ng-repeat ="item in workerInfo.sectionList"
                value="{{item.bidId}}">
                {{item.bidName}}
              </option>
            </select>
          </div>
        </div>       
      </div>
      <div class="row-item">
        <div class="pa-form-control">
          <label class="name fl">施工队:</label>
          <div class="pa-input fl">
            <select id="type" name="type" style="width: 240px;" 
              ng-model="workerInfo.userInfo.constructionTeamId">
              <option value=""></option>
              <optgroup
                ng-repeat="teamGroup in workerInfo.teamWithOrgList"
                label="{{teamGroup.orgUnitName}}">
                <option
                  ng-repeat="team in teamGroup.teamList"
                  value="{{team.teamId}}">
                  {{team.teamName}}
                </option>
              </optgroup>
            </select>
          </div>
        </div>
        <div class="pa-form-control">
          <label class="name fl">项目部:</label>
          <div class="pa-input fl">
            <select id="type" name="type" class="pa-input-select"
              ng-model="workerInfo.userInfo.orgId">
              <option value=""></option>
              <option value="{{::item.orgUnitId}}"
                ng-repeat="item in workerInfo.orgList">
                {{::item.orgUnitName}}
              </option>
            </select>
          </div>
        </div>
        <div class="pa-form-control">
          <label class="name fl">是否特种人员:</label>
          <div class="pa-input fl">
            <select name="isSpecial"
              ng-model="workerInfo.userInfo.isspecialMan">
              <option value=""></option>
              <option value="1">是</option>
              <option value="0">否</option>
            </select>
          </div>
        </div>                       
      </div>
      <div class="row-item">
        <div class="pa-form-control">
          <label class="name fl">进场日期:</label>
          <div class="pa-input fl">
            <input type="text"
              ng-datepicker
              ng-model="workerInfo.userInfo.inTime" />
          </div>
        </div>
        <div class="pa-form-control">
          <label class="name fl">离场日期:</label>
          <div class="pa-input fl">
            <input type="text" ng-datepicker
              ng-model="workerInfo.userInfo.leaveTime" />
          </div>
        </div> 
      </div>
    </form>
    <div class="btn-outer-right">
      <a class="pa-btn" ng-click="workerInfo.query()">
        <i class="fa fa-search"></i>
        <span class="ml5">查询</span>
      </a>
      <a class="pa-btn reset-btn" ng-click="workerInfo.reset();">
        <i class="fa fa-repeat"></i>
        <span class="ml5">重置</span>
      </a>
    </div>
  </div>
  <div class="registration-code">
    <a class="pa-btn"
      authorization-btn="api/safesite/workerInfo/saveRecord"
      ui-sref="workerInfoDetailNew"
      >新增人员</a>
    <a class="pa-btn"
      authorization-btn="api/safesite/workerInfo/leavesite"
      ng-click="workerInfo.forRegistration()">
      离场登记
    </a>
    <a class="pa-btn"
      ng-click="workerInfo.printQrCode()">
      打印二维码
    </a>
  </div>
  <div class="workerInfo-list shadowbox">
    <div class="technical-list-item">
      <div class="list-detail">
        <form class="base-info pa-form-content">
          <table class="pa-table">
            <thead>
              <tr> 
                <th><input type="checkbox"
                  class="form-control-box"
                  ng-model="workerInfo.toggleAllFlag"
                  ng-click="workerInfo.toggleAll()"/>全选</th>
                <th class="time-sequence">
                  <div>档案编号</div>
                  <div class="time-sequence-btn">
                    <div class="time-sequence-box"
                      ng-click="workerInfo.up('record_no','0')">
                      <i class="fa fa-caret-up"></i>
                    </div>
                    <div class="time-sequence-box"
                      ng-click="workerInfo.up('record_no','1')">
                      <i class="fa fa-caret-down"></i>
                    </div> 
                  </div>
                </th>
                <th>姓名</th>
                <th class="time-sequence">
                  <div>进场日期</div>
                  <div class="time-sequence-btn">
                    <div class="time-sequence-box"
                      ng-click="workerInfo.up('intime','0')">
                      <i class="fa fa-caret-up"></i>
                    </div>
                    <div class="time-sequence-box"
                      ng-click="workerInfo.up('intime','1')">
                      <i class="fa fa-caret-down"></i>
                    </div> 
                  </div>                  
                </th>
                <th class="time-sequence">
                  <div>离场日期</div>
                  <div class="time-sequence-btn">
                    <div class="time-sequence-box"
                      ng-click="workerInfo.up('leavetime','0')">
                      <i class="fa fa-caret-up"></i>
                    </div>
                    <div class="time-sequence-box"
                      ng-click="workerInfo.up('leavetime','1')">
                      <i class="fa fa-caret-down"></i>
                    </div> 
                  </div>
                </th>
                <th>岗位类别</th>
                <th>所在单位</th>
                <th>施工队</th>
                <th>特种人员</th>
                <th>操作</th>
              </tr>
            </thead>
            <tbody>
              <tr ng-repeat ="item in workerInfo.workerItemList">
                <td>
                  <input type="checkbox"
                    class="form-control-box"  
                    ng-model="item.checked"
                    ng-change="workerInfo.isChange()"/>
                </td>
                <td>{{item.recordNo}}</td>
                <td>{{item.name}}</td>
                <td>{{item.inTime1}}</td>
                <td>{{item.leaveTime1}}</td>
                <td>{{item.stationCategoryText}}</td>
                <td>{{item.orgName}}</td>
                <td>{{item.constructionTeamName}}</td>
                <td>{{item.isspecialMan == '0' ? '否' :
                  item.isspecialMan == '1' ? '是' : ''}}</td>
                <td>
                  <div class="del"
                    authorization-btn="api/safesite/workerInfo/selectByPrimaryKey"
                    ng-click="$state.go('workerInfoDetail',{id: item.id})">
                    <i class="fa fa-street-view color"></i>
                    <span class="pointer">查看</span>
                  </div>
                  <div class="del"
                    authorization-btn="api/safesite/workerInfo/delete"
                    ng-click="workerInfo.delete(item.id)">
                    <i class="fa fa-trash color"></i>
                    <span class="pointer">删除</span>
                  </div>                  
                </td>
             </tr>            
            </tbody>
          </table>
          <div class="total-num">
            共计<span class="total-num-colorful">{{workerInfo.paginationData.total}}</span>条
          </div>
          <!-- 分页 -->
          <div class="pagination-outer pagination-sm">
            <uib-pagination
              total-items="workerInfo.paginationData.total"
              ng-model="workerInfo.paginationData.pageNum"
              items-per-page="workerInfo.paginationData.pageSize"
              ng-change="pageChange()"
              class="pagination-sm"
              boundary-link-numbers="true"
              max-size="5"
              next-text="下一页"
              previous-text="上一页"></uib-pagination>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>

<script type="text/ng-template" id="workerExitDialog">
  <div class="item-detail-dialog">
    <div class="item-detail-dialog-header">
      <div class="title-txt">
        <span>人员出场</span>
      </div>
    </div>
    <div class="item-detail-dialog-content">
      <div class="row-item">
        <div class="fixed-left-label">出场时间：</div>
      <div style="display: inline-block;line-height: 28px;">
          <input type="text" autofocus="true" style="width:0;height:0;padding:0;" />
          <input type="text" name="leaveTime" ng-datepicker
            ng-model="vm.outPlantTime"/>
        </div>
      </div>           
    </div>
    <div class="item-detail-dialog-footer">
      <a class="pa-btn" ng-click="vm.submit()">
        <i class="fa fa-save"></i>
        <span class="ml5">确定</span>
      </a>
      <a class="pa-btn" ng-click="closeThisDialog()">
        <i class="fa fa-times"></i>
        <span class="ml5">取消</span>
      </a>
    </div>
  </div>
</script>

<script type="text/ng-template" id="workerInfoQrCodePrintDialog">
  <div class="item-detail-dialog">
    <div class="item-detail-dialog-header">
      <div class="title-txt">
        <span>人员信息二维码</span>
      </div>
    </div>
    <div class="item-detail-dialog-content">
      <div class="qr-print-scroll-outer">
        <div class="qr-print">
          <div class="qr-item" style="width: 224px; overflow: hidden; word-wrap: break-word;"
            ng-repeat="item in selectedWorkerList">
            <table class="qr-info" style="width: 100%; height: 100%;">
              <tr>
                <td class="qr-info" style="font-size: 16px;font-weight: 600;">
                  <div style="width: 90px;word-wrap: break-word;padding-right: 6px;">
                    {{::item.name}}
                  </div>
                  <div style="width: 90px;word-wrap: break-word;padding-right: 6px;">
                    {{::item.constructionTeamName}}
                  </div>
                  <div style="width: 90px;word-wrap: break-word;padding-right: 6px;">
                    {{::item.stationCategoryText}}
                  </div>
                </td>
                <td class="qr-img">
                  <img style="width:120px;"
                    ng-src="{{vm.getQrCodeSrc(item)}}">
                </td>
              </tr>
            </table>
          </div>
        </div>
      </div>
    </div>
    <div class="item-detail-dialog-footer">
      <a class="pa-btn" ng-click="vm.print()">
        <i class="fa fa-save"></i>
        <span class="ml5">打印</span>
      </a>
      <a class="pa-btn" ng-click="closeThisDialog()">
        <i class="fa fa-times"></i>
        <span class="ml5">取消</span>
      </a>
    </div>
  </div>
</script>